const router = require('koa-router')()
const { models } = require('../model')
const WorkbenchApps = require('../controller/workbench')
const workbenchAppsController = new WorkbenchApps({ model: models.Topic })
const WorkbenchTask = require('../controller/task')
const workbenchTaskController = new WorkbenchTask({ model: models.Topic })

router.post('/apps/actions/findAll', workbenchAppsController.findAll())
router.post('/apps/actions/findPages', workbenchAppsController.findPages())
router.post('/apps/actions/create', workbenchAppsController.create())
router.post('/apps/actions/updateById', workbenchAppsController.updateById())
router.post('/apps/actions/deleteById', workbenchAppsController.deleteById())

router.post('/task/actions/findAll', workbenchTaskController.findAll())
router.post('/task/actions/findPages', workbenchTaskController.findPages())
router.post('/task/actions/create', workbenchTaskController.create())
router.post('/task/actions/updateById', workbenchTaskController.updateById())
router.post('/task/actions/deleteById', workbenchTaskController.deleteById())

module.exports = router
